<?php
/**
 * Created by PhpStorm.
 * User: changshuiwang
 * Date: 2016/7/14
 * Time: 17:46
 */
namespace console\controllers;

use common\models\Student;
use common\service\RedisCacheSrv;
use yii\console;
use yii\console\Controller;

class TestController extends Controller
{
    public function actionIndex()
    {
        echo "cron service runnning";
    }

    public function actionNum()
    {
        $num=Student::find()->count();
        RedisCacheSrv::upStuNum($num);
        print_r($num);
    }

    public function actionScore()
    {
        $score=Student::find()->average("score");
        print_r($score);
    }
}